package com;

import com.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@SpringBootApplication
@EnableConfigurationProperties(User.class)
public class ApplicationYml implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication.run(ApplicationYml.class,args);
    }
@Autowired
    private User user;


    @Override
    public void run(String... args) throws Exception {
        System.out.println("user.getMyName() = " + user.getMyName());
        System.out.println("user.getCode() = " + user.getCode());
        System.out.println("user.getLastName() = " + user.getLastName());
        System.out.println("user.getLastName().getClass() = " + user.getLastName().getClass());
        user.getAiHao().forEach(System.out::println);
        System.out.println(user.getScores().get("shuxue"));
        System.out.println("user.getAddr().getCity() = " + user.getAddr().getCity());
        System.out.println(user.getAddr().getProvince());
        System.out.println("user.getPort() = " + user.getPort());
    }
}
